<script setup lang="ts">
import { computed } from "vue";

const props = defineProps<{
    size: number,
    qq?: string
}>();

const spec = computed(() => {
    if (props.size <= 30) {
        return 1; // 40x40
    }
    if (props.size <= 90) {
        return 3; // 100x100
    }
    if (props.size <= 130) {
        return 4; // 140x140
    }
    return 5; // 640x640
});

</script>

<template>
    <n-avatar round :size="props.size" :src="`https://q2.qlogo.cn/headimg_dl?dst_uin=${props.qq}&spec=${spec}`"/>
</template>

<style scoped>

</style>